package hao.bk.royalmap;

import android.content.Context;
import android.os.Handler;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

/**
 * Hiệu ứng animation cho ứng dụng
 * 
 * @author HaoDV 
 */
public class GeneralAnimationUtils {
	/** Hiệu ứng chuyển tab trái sang phải */
	public static void startLeftToRight(View viewHide, View viewShow) {
		Context context = RoyalMapActivity.getInstance();
		Animation animLeftToRightShow = AnimationUtils.loadAnimation(context,
				R.anim.anim_left_to_right_show);
		Animation animRightToLeftHide = AnimationUtils.loadAnimation(context,
				R.anim.anim_right_to_left_hide);
		viewHide.startAnimation(animRightToLeftHide);
		viewShow.startAnimation(animLeftToRightShow);

	}

	/** Hiệu ứng chuyển tab phải sang trái */
	public static void startRightToLeft(final View viewHide, View viewShow) {
		Context context = RoyalMapActivity.getInstance();
		final Animation animRightToLeftShow = AnimationUtils.loadAnimation(
				context, R.anim.anim_right_to_left_show);
		Animation animLeftToRightHide = AnimationUtils.loadAnimation(context,
				R.anim.anim_left_to_right_hide);
		viewHide.startAnimation(animLeftToRightHide);
		viewShow.startAnimation(animRightToLeftShow);
	}
	
	/** Hiệu ứng hiển thị từ dưới lên trên */
	public static void startBottomToTop(View viewShow) {
		Context context = RoyalMapActivity.getInstance();
		final Animation animTopToBottomShow = AnimationUtils.loadAnimation(context,
				R.anim.anim_bottom_to_top_show);
		viewShow.startAnimation(animTopToBottomShow);
	}
	
	/** Hiệu ứng ẩn từ trên xuống dưới */
	public static void startTopToBottom(View viewHide) {
		Context context = RoyalMapActivity.getInstance();
		Animation animBottomToTopHide = AnimationUtils.loadAnimation(context,
				R.anim.anim_top_to_bottom_hide);
		viewHide.startAnimation(animBottomToTopHide);

	}

}
